<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="flex-box border-hover-style">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img class="outline-parent-bg" :src="publicUrls + 'free/style8/Level2outlineStyle3Bg.webp'" alt="" />
      <div class="outline">
        <div
          class="outline-content"
          :class="!props.info.subTitle && !props.info.value && 'outline-content2'"
          v-if="props.info.value || props.info.subTitle || props.info.remarks"
        >
          <div class="content-box-right" v-if="props.info.text?.length > 10" v-html="textType(props.info.text)"></div>
          <div class="content-box-right" :style="{ width: '100%' }" v-else>{{ props.info.text }}</div>
          <div class="content-box"> 
            <img
              class="outline-bg2"
              v-if="!props.info.value"
              :src="publicUrls + 'free/style8/Level2titlebg.webp'"
              alt=""
            />
            <p class="outline-subTitle" v-if="props.info.subTitle" :class="!props.info.value && 'subMargin'">
              {{ props.info.subTitle }}
            </p> 
            <img
              class="outline-bg"
              :class="!props.info.subTitle && 'outline-bg4'"
              v-if="props.info.value"
              :src="publicUrls + 'free/style8/Level2titlebg.webp'"
              alt=""
            />
            <div class="cover" v-if="props.info.value">
              <img
                class="outline-cover"
                @click="ImgVisible = true"
                :src="urls + props.info.value + '?imageView2/3/format/webp'"
                alt=""
              />
            </div>
            <img
              class="outline-bg"
              v-if="props.info.value"
              :src="publicUrls + 'free/style8/Level2titlebg.webp'"
              alt=""
            />
            <TextMax
              v-if="props.domShow"
              :style="!props.info.value && 'margin-top: 0'"
              :data="props.info.remarks"
              :title="props.info.text"
              :infoData="props.info"
              :row="props.info.value ? 4 : 8"
            ></TextMax>
            <img
              class="outline-bg2 outline-bg3"
              v-if="!props.info.value"
              :src="publicUrls + 'free/style8/Level2titlebg.webp'"
              alt=""
            />
          </div>
        </div>
        <div class="outline-content outline-content3" v-else>
          <img class="outline-bg5" :src="publicUrls + 'free/style8/Level2titlebg.webp'" alt="" />
          <div
            class="content-box-right content-box-right2"
            v-if="props.info.text?.length > 10"
            v-html="textType(props.info.text)"
          ></div>
          <div class="content-box-right content-box-right2" :style="{ width: '100%' }" v-else>
            {{ props.info.text }}
          </div>
          <img class="outline-bg5" :src="publicUrls + 'free/style8/Level2titlebg.webp'" alt="" />
        </div>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style8/firstLevelOutline1Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free8Style3',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import textMode from '../../../textMode/textMode.vue';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style8.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-left: 80px;
  margin-right: 90px;
}
.Showroom-parent {
  position: absolute;
  top: 54px;
  right: 41.5%;
  transform: translate(-41.5%, 0);
  z-index: 21;
}
.shadow {
  width: 620px;
  height: 188px;
  position: absolute;
  bottom: -30px;
  left: -25px;
}
.flex-box {
  width: 470px;
  height: 768px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
}
.outline {
  z-index: 20;
  width: 100%;
  height: 100%;
  padding: 148px 102px 79px 92px;
}
.content-box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.outline-content2 {
  justify-content: space-between !important;
}
.outline-content3 {
  justify-content: center !important;
  padding-bottom: 70px;
}
.outline-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}
.outline-bg5 {
  width: 100%;
  height: 18px;
  object-fit: contain;
}
.content-box-right2 {
  margin: 40px 0 !important;
}
.content-box-right {
  margin-bottom: 16px;
  color: #4f6e5c;
  text-align: center;
  font-family: 'SourceHanSerifCN-Bold';
  font-size: 24px;
  line-height: 36px;
  ::v-deep p {
    color: #4f6e5c;
    text-align: center;
    font-family: 'SourceHanSerifCN-Bold';
    font-size: 24px;
    line-height: 36px;
  }
}
.outline-bg {
  width: 100%;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}
.outline-bg4 {
  margin-top: 24px;
}
.outline-bg2 {
  width: 100%;
  height: 18px;
  object-fit: contain;
  margin-top: 24px;
  margin-bottom: 40px;
}
.outline-bg3 {
  margin-top: 40px;
  margin-bottom: 0;
}
.subMargin {
  margin-bottom: 24px !important;
}
.outline-subTitle {
  width: 100%;
  min-height: 48px;
  color: rgba(79, 110, 92, 0.5);
  text-align: center;
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  line-height: 24px;
  text-align: center;
  margin-bottom: 32px;
}
.cover {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  max-height: 224px;
  margin: 12px 0;
  overflow: hidden;
  background: rgba(116, 109, 99, 1);
  &:hover .outline-cover {
    transform: scale(1.2);
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}

::v-deep .textMore-box {
  margin-top: 32px;
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(0, 0, 0, 0.59) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: rgba(52, 87, 70, 1) !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>